from django.db import models

from apps.index.models import IndexUser


class MatchStaple(models.Model):
    name = models.CharField(max_length=255,verbose_name='三餐名字')

    class Meta:
        db_table = 'match_staple'
        verbose_name = '主食'
        verbose_name_plural = verbose_name

class MatchMeal(models.Model):
    name = models.CharField(max_length=255,verbose_name='营养搭配')
    introduce = models.CharField(max_length=255,verbose_name='介绍')
    user = models.ForeignKey(IndexUser,verbose_name='所属用户')
    match_staple = models.ForeignKey(MatchStaple,verbose_name='所属三餐')


    class Meta:
        db_table = 'match_meal'
        verbose_name = '搭配'
        verbose_name_plural = verbose_name


class  MatchFood(models.Model):
    name = models.CharField(max_length=255,verbose_name='食物')
    match_meal = models.ForeignKey(MatchStaple,verbose_name='所属搭配')

    class Meta:
        db_table = 'match_food'
        verbose_name = '食物'
        verbose_name_plural = verbose_name